package com.zjj.day0504.treeset;

import java.util.TreeSet;

/**
 * @author zhoujunjie
 * @desc TODO
 * @date 2025/5/4
 */
public class Sort {
    public static void main(String[] args) {
        String str = "8 10 15 5 2 7";
        TreeSet<Integer> number = new TreeSet<>();
        String[] strs = str.split(" ");
        for (String s : strs) {
            number.add(Integer.parseInt(s));
        }
        StringBuilder result = new StringBuilder();
        for (int num : number) {
            if (result.length() > 0) {
                result.append(",");
            }
            result.append(num);
        }
        System.out.println(result);
    }
}
